package cn.edu.cdu.group4nb.service;

import cn.edu.cdu.group4nb.po.PageInf;
import cn.edu.cdu.group4nb.po.RoleInf;
import cn.edu.cdu.group4nb.po.UserInf;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @auther: tupeng
 * @date: 2019-10-09 12:35
 */
@Service
public interface UserService {
    //角色信息
    boolean checkUserName(String userid);

    void Register(UserInf userInf);

    void updatePassword(@Param("newPassword") String newPassword,
                        @Param("username") String username);

    //用户信息
    List<UserInf> queryAllUser();

    void addUser(UserInf userInf);

    void deleteUser(int[] user_info_id);

    RoleInf queryUserById(int user_info_id);

    void updateUser(@Param("userid") String userid,
                    @Param("password") String password,
                    @Param("name") String name,
                    @Param("githubURL") String githubURL,
                    @Param("email") String email,
                    @Param("user_info_id") String user_info_id);

    List<RoleInf> getRoleById(int user_info_id);

    void addRoleToUser(RoleInf roleInf);

    void deleteRoleFromUser(int[] roleid);



    List<PageInf> getPageById(int roleid);

    void addPageToRole(PageInf pageInf);

    PageInf queryPageByRoleId(int roleid);

    void deletePageFromRole(int[] pageid);

    List<PageInf> queryAllPage();
}
